import request from '@/utils/request'

export default{


    //根据课程id删除课程
  removeById(id) {
    return request({
        url: `/eduservice/course//${id}`,
        method: 'delete'
    })
  },

  //条件分页查询课程列表
  getPageList(page, limit, searchObj) {
      return request({
        url: `/eduservice/course/${page}/${limit}`,
        method: 'get',
        params: searchObj
      })
    },



  //课程最终发布api
  //信息回显
  getCoursePublishInfoById(id) {
      return request({
        url: `/eduservice/course/getCoursePublishInfo/${id}`,
      })
    },
    
    //发布
    publishCourse(id) {
      return request({
        url: `/eduservice/course/publish/${id}`
      })
    },


  //添加课程基本信息
  addCourseInfo(courseInfo){
      return request({
          url:'/eduservice/course/addCourseInfo',
          data:courseInfo,
          method:'post'
      })
  },

  //获取所有讲师
  findAll(){
      return request({
          url:'/eduservice/teacher/findAll'
      })
  },

  //根据课程id获取章节和小节
  getChapterOrVideo(courseId){
      return request({
          url:'/eduservice/course/getChapterOrVideo/'+courseId
      })
  },

  //根据课程id获取课程信息
  getCourse(courseId){
      return request({
          url:'/eduservice/course/'+courseId
      })
  },

  //更新课程信息
  updateCourse(courseInfo){
      return request({
          url:'/eduservice/course/updateCourse',
          data:courseInfo,
          method:'post'
      })
  }
}